﻿@namespace Masa.Blazor.Docs.Examples.components.textareas

<MTextarea @bind-Value="_value"
           Outlined="Outlined"
           Solo="Solo"
           Filled="Filled"
           PrependIcon="@PrependIcon"
           Clearable="Clearable"
           Label="@Label">
</MTextarea>

@code {

    private string? _value;

    [Parameter]
    public bool Outlined { get; set; }

    [Parameter]
    public bool Filled { get; set; }

    [Parameter]
    public bool Solo { get; set; }

    [Parameter]
    public string? PrependIcon { get; set; }

    [Parameter]
    public bool Clearable { get; set; }

    [Parameter]
    public string? Label { get; set; }

    private bool _prevClearable;

    protected override void OnParametersSet()
    {
        base.OnParametersSet();

        if (_prevClearable != Clearable)
        {
            _prevClearable = Clearable;

            if (Clearable)
            {
                _value = "Hover to Clear me";
            }
        }
    }

}
